package service;

import java.util.ArrayList;

import model.Matrix;

public class GraphService
{
	private static GraphService gs = new GraphService();
	private Matrix m;
	
	private GraphService()
	{
	}
	
	public static GraphService getInstance()
	{
		return gs;
	}
	
	public void createMatrix(int dots)
	{
		m = new Matrix(dots);
	}
	
	public int[][] getMatrix()
	{
		return m.getMatrix();
	}
	
	public int[][] getNPower(int n)
	{
		return m.getPower(n);
	}
	
	public int[][] calculatePathMatrix(int[][] matrix)
	{
		return m.calculatePathMatrix(matrix);
	}
	
	public int[][] calculateDistanceMatrix(int[][] matrix)
	{
		return m.calculateDistanceMatrix(matrix);
	}
	
	public int[] calculateEccentricity()
	{
		return m.calculateEccentricity();
	}
	
	public void copyMatrices(int[][] matrix)
	{
		m.copyMatrices(matrix);
	}
	
	public void printArray(int[][] matrix)
	{
		m.printArray(matrix);
	}
	
	public boolean isConnected(int[][] pmatrix, int dim)
	{
		return m.isConnected(pmatrix, dim);
	}
	
	public ArrayList<ArrayList<Integer>> calculateComponents(int[][] pathmatrix)
	{
		return m.calculateComponents(pathmatrix);
	}
	
	public ArrayList<Integer> calculateArticulations(ArrayList<ArrayList<Integer>> components, int[][] matrix)
	{
		return m.calculateArticulations(components, matrix);
	}
	
	public ArrayList<ArrayList<Integer>> calculateBridges(ArrayList<ArrayList<Integer>> components, int[][] matrix)
	{
		return m.calculateBridges(components, matrix);
	}
}
